<script setup lang="ts">
defineProps<{
  TYPE: "CSS" | "JS";
}>();
</script>

<template>
  <div ref="CSSBox" class="Gab-CSSBox w-full h-full flex">
    <main :class="TYPE" class="w-full h-full flex items-center justify-center">
      <div
        class="G-tag z-10 absolute left-0 top-0 flex items-center justify-center"
      >
        {{ TYPE }}
      </div>
      <div class="CSSBox-content w-full h-full flex items-center justify-center box-border relative">
        <slot />
      </div>
    </main>
  </div>
</template>

<style lang="less" scoped>
.Gab-CSSBox {
  position: relative;
  box-sizing: border-box;
  padding: 1rem;
  main {
    border: 2px solid var(--vast-default-border-color);
    border-radius: 1rem;
    overflow: hidden;
    position: relative;
    .CSSBox-content {
      border-radius: 1rem;
      overflow: hidden;
      z-index: 0;
    }
    &.JS {
      .G-tag {
        background-color: #f1db4e;
        color: #333432;
      }
    }
    &.CSS {
      .G-tag {
        background-color: #33abde;
        color: #ffffff;
      }
    }
  }
  .G-tag {
    width: 4rem;
    height: 2.5rem;
    border-radius: 1rem 0;
    border-right: 2px solid var(--vast-default-border-color);
    border-bottom: 2px solid var(--vast-default-border-color);
    font-weight: bold;
    font-size: 1.25rem;
  }
}
</style>
